/*
 * @Descripttion: 
 * @version: 
 * @Author: cyj
 * @Date: 2022-12-05 10:40:17
 */
import { createApp } from 'vue'
// import './style.css'
import "./assets/css/base.css";

import App from './App.vue'
//引入element-plus
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'

//引入pinia
import { createPinia } from 'pinia'
//创建pinia实例
const store = createPinia()

//引入router
import router from './router'

//导入图标库
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

const app = createApp(App)
//注册图标库
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}

//导入格式化数字插件
import formatNum from './utils/formatNum'
app.use(formatNum)
//导入格式化时长插件
import formatDuration from './utils/formatDuration';
app.use(formatDuration)


import loadImg from '@/assets/images/loadImg.gif'
//使用图片懒加载
import lazyPlugin from 'vue3-lazy';
lazyPlugin.install(app, {
  loading: loadImg,
  error: '',
})

// 数据持久化插件
import piniaPersist from 'pinia-plugin-persist'
//使用插件
store.use(piniaPersist)
//注册插件 —— pinia
app.use(store)

//注册插件 —— ElementPlus
app.use(ElementPlus)
//注册插件 router
app.use(router)

app.mount('#app')
